<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script>
        let a = 10;
        ++a; // ++a  11    a = 11
        const b = ++a + 2; // a = 12   ++a = 12
        console.log(b); // 14

        let c = 10;
        c++; // c++ 11  c = 11
        const d = c++ + 2; //  c++  = 11     c = 12
        console.log(d); // 13

        let e = 10;
        const f = e++ + ++e; // 1. e++ =  10  e = 11  2. e = 12  ++e = 12
        console.log(f); // 22
        // 后置自增  先表达式返回原值 后面变量再自加1
    </script>
</head>

<body>

</body>

</html>
